home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
TCL1
/
__MANDEL
/
MANDELBR
/
CPIXMAPP.C
< prev
next >
Wrap
Text File
|
1992-05-31
|
2KB
|
80 lines
/******************************************************************************
CPixMapPane.c
******************************************************************************/
#include "Global.h"
#include "CPixMapPane.h"
void CPixMapPane::IPixMapPane(
CView *anEnclosure,
CBureaucrat *aSupervisor,
short aWidth,
short aHeight,
short aHEncl,
short aVEncl,
SizingOption aHSizing,
SizingOption aVSizing,
CPixMap * aPixMap)
{
Rect aBoundsRect;
CPanorama::IPanorama(anEnclosure, aSupervisor,
aWidth, aHeight, aHEncl, aVEncl, aHSizing, aVSizing);
itsPixMap = aPixMap;
itsPixMap->GetBounds(&aBoundsRect);
QDToLongRect(&aBoundsRect, &bounds);
position.h = bounds.left;
position.v = bounds.top;
autoRefresh = FALSE;
}
void CPixMapPane::SetPixMap(
CPixMap* aPixMap)
{
Rect aBounds;
LongRect aLongBounds;
itsPixMap = aPixMap; /* Set instance variable */
itsPixMap->GetBounds(&aBounds);
QDToLongRect(&aBounds, &aLongBounds);
SetBounds(&aLongBounds);
}
CPixMap* CPixMapPane::GetPixMap()
{
return(itsPixMap);
}
void CPixMapPane::Draw(
Rect *area)
{
Rect aBoundsRect;
LongRect lArea;
if (itsPixMap != NULL) {
itsPixMap->GetBounds(&aBoundsRect);
SectRect(area, &aBoundsRect, area);
QDToFrameR( area, &lArea);
itsPixMap->CopyFrom( &lArea, &lArea, NULL);
}
}
PicHandle CPixMapPane::GetPicHandle(void)
{
PicHandle aPictH;
Rect aBoundsRect;
LongRect aLongRect;
Prepare();
itsPixMap->GetBounds(&aBoundsRect);
aPictH = OpenPicture(&aBoundsRect);
QDToLongRect(&aBoundsRect, &aLongRect);
itsPixMap->CopyFrom( &aLongRect, &aLongRect, NULL);
ClosePicture();
return aPictH;
}